package com.wushi.lenovo.asia5b.app_di.profile.presenter;

import com.mvp.base.BasePresenter;
import com.mvp.helper.WCallBack;
import com.wushi.lenovo.asia5b.app_di.profile.mvpview.MobileInfoActivityView;
import com.wushi.lenovo.asia5b.app_http.ApiService;
import com.wushi.lenovo.asia5b.app_model.other.CacheType;
import com.wushi.lenovo.asia5b.app_model.profile.CountryModel;
import com.wushi.lenovo.asia5b.app_utils.helper.CacheHelper;

import java.util.List;

import javax.inject.Inject;


/**
 * Created by zhangyuncai on 2019/1/22.
 */
public class MobileInfoActivityPresenter extends BasePresenter<MobileInfoActivityView> {

    ApiService apiService;

    @Inject
    public MobileInfoActivityPresenter(ApiService apiService) {
        this.apiService = apiService;
    }
    //获取国家列表
    public void getCountrys() {
        CacheHelper.getCountrys(new WCallBack<List<CountryModel>>() {
            @Override
            public void callback(List<CountryModel> countryModels) {
                getView().getCountrysResult(countryModels);
            }
        }, CacheType.LOCAL);
//        baseSubscribe(apiService.getCountrys(), listResultModel -> {
//            getView().getCountrysResult(listResultModel.getData());
//        });
    }
}